package 线程.线程池;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class 有上限的线程池 {
    public static void main(String[] args) {
        //1.创建有限的线程
        ExecutorService pool = Executors.newFixedThreadPool(3);

        //2.提交线程要执行的任务
        pool.submit(new MyRun());
        pool.submit(new MyRun());
        pool.submit(new MyRun());
        System.out.println(pool);
    }
}
